<template>
	<div v-if="user.isLonginIn">
		<el-config-provider :locale="locale">
			<Layout></Layout>
		</el-config-provider>
	</div>
	<div v-else>
		<!-- 登录组件 -->
		<Login></Login>
	</div>
</template>

<script lang="ts">
import { defineComponent, ref, onMounted, provide } from "vue";
import Layout from "./views/layout/index.vue";
import Login from "./views/Login/login.vue";
import  useUser  from "./hook/user"

import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'

import * as echarts from 'echarts'

import {watch} from 'vue';

export default defineComponent({
	name: "App",
	components: { Layout, Login, ElConfigProvider, },
	setup() {
		let user = useUser();
		
		provide('echart',echarts)
		return { user, locale: zhCn, };
	},
});
</script>

<style scoped lang="sass"></style>
